﻿<div ng-controller="cursoController" class="container">
    <form class="form-horizontal" ng-submit="save()" ng-show="formVisibility">
        <div class="form-group">
            <label class="control-label col-xs-3">Curso:</label>
            <div class="col-xs-9">
                <input type="text" class="form-control" placeholder="Nombre del Curso" ng-model="curso.Nombrec">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-3">Profesor:</label>
            <div class="col-xs-9">
                <input type="text" class="form-control" placeholder="Profesor" ng-model="curso.Profesor">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-3">Horas:</label>
            <div class="col-xs-9">
                <input type="text" class="form-control" placeholder="Horas" ng-model="curso.Horasc">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-3">Creditos:</label>
            <div class="col-xs-9">
                <input type="text" class="form-control" placeholder="Creditos" ng-model="curso.Creditos">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-3">Costo del Curso:</label>
            <div class="col-xs-9">
                <input type="text" class="form-control" placeholder="Costo del Curso" ng-model="curso.Costo_curso">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-3">Duracion del Curso:</label>
            <div class="col-xs-9">
                <input type="text" class="form-control" placeholder="Duracion del Curso" ng-model="curso.Duracion_curso">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-3">Observaciones:</label>
            <div class="col-xs-9">
                <textarea rows="3" class="form-control" placeholder="Observaciones" ng-model="curso.Observaciones"></textarea>
            </div>
        </div>

        <br>
        <div class="form-group">
            <div class="col-xs-offset-3 col-xs-9">
                <button type="button" class="btn btn-default" ng-click="cancel()">Cancel </button>
                <button class="btn btn-primary" type="submit">Save</button>
            </div>
        </div>

    </form>
    <h3>LISTA DE CURSOS</h3>
    <table class="table table-hover table-bordered">
        <tr>
            <th>Nombre</th>
            <th>Profesor</th>
            <th>Horas</th>
            <th>Creditos</th>
            <th>Costo de Curso</th>
            <th>Duracion del Curso</th>
            <th>Observaciones</th>
            <th>Opciones</th>
        </tr>
        <tr ng-repeat="c in cursos">
            <td>{{c.Nombrec}}</td>
            <td>{{c.Profesor}}</td>
            <td>{{c.Horasc}}</td>
            <td>{{c.Creditos}}</td>
            <td>{{c.Costo_curso}}</td>
            <td>{{c.Duracion_curso}}</td>
            <td>{{c.Observaciones}}</td>
            <td>
                <button ng-click="selec(c)" type="button" class="btn btn-primary"><i class="glyphicon glyphicon-pencil"></i> <span>Editar</span></button>
                <button ng-click="delete(c.CursoId)" type="button" class="btn btn-danger"><i class="glyphicon glyphicon-trash"></i> <span>Eliminar</span></button>
            </td>

        </tr>
    </table>
    <button ng-click="ShowForm()" ng-hide="formVisibility" type="button" class="btn btn-primary"><i class="glyphicon glyphicon-plus"></i> Agregar Curso</button>
</div>
